import { EntitySchema } from '@mikro-orm/core';

export class ChatMessages {
  id!: string;
  createdAt?: Date;
  updatedAt?: Date;
  creatorId?: string;
  ownerId?: string;
  type?: string;
  content?: string;
}

export const ChatMessagesSchema = new EntitySchema({
  class: ChatMessages,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    createdAt: { type: 'Date', length: 0, nullable: true },
    updatedAt: { type: 'Date', length: 0, nullable: true },
    creatorId: { type: 'string', columnType: 'bigint', nullable: true },
    ownerId: { type: 'string', columnType: 'bigint', nullable: true },
    type: { type: 'string', length: 255, nullable: true },
    content: { type: 'string', length: 255, nullable: true },
  },
});
